package zju.xmsx.acm.search.back.dto;

import java.util.Map;

import org.elasticsearch.search.SearchHit;

public class SearchResult {
    public String id;
    public String index;
    public float score;
    public Map<String, Object> sourceAsMap;

    public SearchResult(String id, String index, float score, Map<String, Object> sourceASMap) {
        this.id = id;
        this.index = index;
        this.score = score;
        this.sourceAsMap = sourceASMap;
    }

    public SearchResult(SearchHit param) {
        this.id = param.getId();
        this.index = param.getIndex();
        this.score = param.getScore();
        this.sourceAsMap = param.getSourceAsMap();
    }
}
